//接收命令行参数,process.argv参数从第三个开始，即process.argv[2]
var arg = process.argv[2];
if((typeof arg) == 'undefined'){
    console.log("please input arg!");
}
if(arg == "--help"){
    console.log("program --help");
}
for(process.argv.length; process.argv.length>2; process.argv.length--){
    try{
        var result = eval(arr[process.argv.length-1]);
        if(!isNaN(result)){
            console.log(result);
        }else{
            console.error("err");
        }
    }catch{
        console.log("err");
    }
}
//若为运算式，做求值处理
var result = eval(arg);
if(!isNaN(parseInt(result))){
    console.log(arg + "=" + result);
}
